cc.Class({
    extends: cc.Component,

    properties: {
        target: cc.Node
    },

    onLoad() {
        this.camera = this.node.getComponent(cc.Camera)
        cc.director.getPhysicsManager().attachDebugDrawToCamera(this.camera)
    },

    lateUpdate() {
        if (this.target) {
            this.node.setPosition(this.target.convertToWorldSpaceAR(cc.Vec2.ZERO))
        }
    }
})